package com.relax;



import com.relax.config.ShiwuConfig;
import com.relax.shiwu.ServiceShiwu;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author admin
 */
public class SpringApplicationDemo_shiwu {


    @Test
    public void test_shiwu() {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ShiwuConfig.class);
        //查看容器中所有的bean
        String[] beanDefinitionNames = context.getBeanDefinitionNames();
        for (String name : beanDefinitionNames) {
            System.out.println(name);

        }

        ServiceShiwu serviceA = context.getBean(ServiceShiwu.class);
        serviceA.out();
    }


}
